<!-- userDelete.php 用于根据id删除用户。 -->

<?php

	require_once('inc_admin.php');

	connect();
  
	$id = $_GET['id'];

	$sql="select * from users where uid={$id}";

	$result=mysql_query($sql);

	$row=mysql_fetch_assoc($result);

	$filename=UserPhotoPath.$row["pic"];

	$sql = "delete from users where uid={$id}";

	$result = mysql_query($sql) or die('删除失败！'.mysql_error());

	if(!mysql_error()){


		if($filename!=UserPhotoPath && file_exists($filename))

			unlink($filename);

		redirect('userList.php', '删除成功！');

	}	

?>



